package com.clip.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.clip.dao.AlertUserDAO;
import com.clip.entity.AlertUser;

@Service
@Transactional
public class AlertUserService {
	@Autowired
	private AlertUserDAO alertUserDAO;
	public long getInviteNum(Integer eventid){
		String query="select count(*) from AlertUser au where au.eventid="+eventid;
		Long num=(Long) alertUserDAO.countByQuery(query);
		return num;
	}
	public List<AlertUser> getAlertUsersByEventid(Integer eventid){
		return this.alertUserDAO.findByQuery("from AlertUser au where au.eventid="+eventid);
	} 
}
